package com.xilihui.xlh.business.activitys;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.xilihui.xlh.R;
import com.xilihui.xlh.business.entities.DownloadMsg;
import com.xilihui.xlh.component.recyclerview.BaseAdapter;
import com.xilihui.xlh.component.recyclerview.BaseViewHolder;
import com.xilihui.xlh.core.app.BaseCompatActivity;
import com.xilihui.xlh.core.app.ToolBaseCompatActivity;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by Administrator on 2018/5/17.
 */

public class RobBillActivity extends ToolBaseCompatActivity{
    
    @BindView(R.id.recyclerview)
    RecyclerView recyclerView;
    
    @Override
    public int getLayout() {
        return R.layout.activity_rob_bill;
    }
    
    @OnClick(R.id.iv_toolbar_left)
    public void back(){
        finish();
    }
    
    @OnClick(R.id.tv_toolbar_right)
    public void record(){
        startActivity(new Intent(this,RobBillRecordActivity.class));
    }

    @Override
    public String initTitle() {
        return null;
    }

    @Override
    public void initUI(@Nullable Bundle savedInstanceState) {
        setToolTitle("在线抢单");
        setToolRightText("记录");

        ArrayList<DownloadMsg> data = new ArrayList<>();
        for (int i=0;i<10;i++){
            data.add(new DownloadMsg(0,0));
        }
        
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        
        recyclerView.setAdapter(new BaseAdapter<DownloadMsg>(this,data){

            @Override
            protected int setLayoutId() {
                return R.layout.recycler_item_rob_bill;
            }

            @Override
            protected void getView(BaseViewHolder holder, DownloadMsg entity, int position) {
                holder.itemView.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        startActivity(new Intent(RobBillActivity.this,EvaluationStoreActivity.class));
                    }
                });
            }
        });
        
        
        
    }

    @Override
    public void initData() {
        
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
